Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | 'use strict'; |
||
39 | self.startup = function() { |
||
40 | savegame.load(); |
||
41 | let elapsed = Math.floor(Date.now()/1000)-state.player.last_login; |
||
42 | let total = util.calculateValue(data.global_upgrades.offline_time.power.base, |
||
43 | data.global_upgrades.offline_time.power, |
||
44 | state.player.global_upgrades.offline_time); |
||
45 | // lets limit the offline elapsed time |
||
46 | state.player.offline = Math.min(total, state.player.offline+elapsed); |
||
47 | |||
48 | state.loading = false; |
||
49 | // trigger the game loop |
||
50 | $timeout(self.updateLoop, 1000); |
||
51 | $interval(savegame.save, 10000); |
||
52 | }; |
||
53 | |||
57 |